//申领或者感感兴趣
function userDoPlan(planid,status){
	$.ajax({
		type: "POST",
		url: siteUrl+"index.php/plan/do/ts-doplan",
		data: "planid="+planid+"&status="+status,
		beforeSend:function(){
		},
		success:function(result){
			if(result == '0'){
				art.dialog.open(siteUrl+'index.php/user/ajax/ts-login', {title: '登录'});
			}else if(result == '1'){
				art.dialog({
					icon: 'warning',
					content: '你已经申报了该方案^_^'
				});
			}else if(result == '2'){
				art.dialog({
					time: 3,
					icon: 'succeed',
					content: '申报方案成功^_^'
				});
				window.location.reload(); 
			}
		}
	});
}

//取消申领方案
function cancelPlan(planid,userid){
	art.dialog.confirm('确定不申报了吗？', function(){
	$.ajax({
		type: "POST",
		url: siteUrl+"index.php/plan/do/ts-cancel",
		data: "planid="+planid+"&userid="+userid,
		beforeSend:function(){
		},
		success:function(result){
			if(result == '1'){
				art.dialog({
					time: 3,
					icon: 'succeed',
					content: '取消申报方案^_^'
				});
				window.location.reload(); 
			}
		}
	});
	});
}

//申领方案
function doPlan(planid,userid){
	$.ajax({
		type: "POST",
		url: siteUrl+"index.php/plan/do/ts-do",
		data: "planid="+planid+"&userid="+userid,
		beforeSend:function(){
		},
		success:function(result){
			if(result == '1'){
				art.dialog({
					time: 3,
					icon: 'succeed',
					content: '申报方案成功^_^'
				});
				window.location.reload(); 
			}
		}
	});
}

